﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace helloworld2.MODEL
{
    class EdgeContainer
    {

        private static EdgeContainer instance = null;

        private EdgeContainer()
        {
        }

        public static EdgeContainer Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new EdgeContainer();
                }
                return instance;
            }
        }

        List<Edge> edges = new List<Edge>();

        public void addEdge(Edge newEdge)
        {
            edges.Add(newEdge);
        }

        public List<Edge> getEdges()
        {
            //List<Edge> edges = new List<Edge>();
            //foreach (Edge e in edges)
            //{
            //    edges.Add(e);

            //}
            return this.edges;
        }

        public Edge getEdgeByID(int id)
        {
            Edge e = new Edge();
            foreach (Edge ee in edges) 
            {
                if (ee.id.Equals(id))
                {
                    e = ee;
                }
            }
            return e;
        }
    
    
    
    
    }
}
